package  main

import (
	"fmt"
	"net"
)

func main()  {
	conn ,err := net.Dial("tcp","127.0.0.1:8888")
	if err != nil {
		fmt.Println("连接失败，错误：",err)
		return
	}
	defer conn.Close()
	//inputReader := bufio.NewReader(os.Stdout)
	for {
		fmt.Println("读取用户输入")
		_,err = conn.Write([]byte("1111111111111111111111"))   //发送数据
		if err != nil{
			return
		}
		buf := [512]byte{}
		n,err := conn.Read(buf[:])
		if err != nil{
			fmt.Println("接受失败，错误：",err)
			return
		}
		fmt.Println(string(buf[:n]))
		break
	}
}